package org.csmzxy.class2333;
import java.util.ArrayList;
import java.util.List;
public class Example01 {
    public static void main(String[] args){
        List list = new ArrayList();
        list.add("apple");
        list.add("banana");
        list.add("banana");
        list.add("orange");
        System.out.println("在List集合中添加四个元素："+ list);
        list.add(2,"peach");
        System.out.println("在索引为2的位置后插入元素后："+ list);
        list.remove(3);
        System.out.println(list);
        System.out.println(list.get(3));
        System.out.println(list.set(2,"grapes"));
        System.out.println(list);
        System.out.println(list.size());

    }
}
